<%--
  @author Sisiruwan Senadeera
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script type="text/javascript">
    $(document).ready(function() {
//        if(document.getElementById("userName").value == "admin"){
//            $("#userList").hide();
//        }

        $('.land-table').dataTable({
            "oTableTools": {
                "aButtons": [
                    {
                        "sExtends": "print",
                        "bShowAll": true
                    }
                ]
            }
        });
    });
</script>

<div id="alienation-methods-module-home-title" class="module-home-title">
    <s:a href="introduceNewAlienationMethodsModule.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                   alt="User Module"><span><s:label
            value="%{getText('introduction_of_new_alianation_method.label')}"/></span></s:a>
    <div id="back-button" align="right">
        <s:submit type="input" value="%{getText('back.label')}" onclick="goBack();"/>
    </div>
</div>

<div id="update-alienation-methods-div">
    <%--<h2><s:label value="%{getText('update_user.label')}"/></h2>--%>
    <h2><s:label value="%{getText('update_alienation_method.label')}"/></h2>
    <table>
        <tr>
            <td colspan="2" class="left-align">
                <div class="action-msg"><s:actionmessage/></div>
                <div class="action-err"><s:actionerror/></div>
            </td>
        </tr>
    </table>

    <%--<table>
        <tr>
            <s:form name="searchUsersByRole" id="searchUsersByRole" method="POST">
        <tr>
            <td class="left-align"><s:label value="%{getText('role_id.label')}"/></td>
            <td><s:select id="roleId" name="roleId" list="roleSet" headerKey="0"
                          headerValue="%{getText('select.label')}"/></td>
            <td><s:submit action="searchUsersByRole" value="%{getText('search.label')}"/></td>
        </tr>

        </s:form>
        </tr>
    </table>--%>
    </br>

    <table class="width-100 margin-10-auto table land-table">
        <thead>
        <tr class="left-align table-header">
            <th class=""><s:label value="%{getText('alienation_method_id.label')}"/></th>
            <th class=""><s:label value="%{getText('alienation_methods.label')}"/></th>
            <th class="" align="right"><s:label value="%{getText('edit.label')}"/></th>
            <th></th>
        </tr>
        </thead>
        <tbody>

        <s:iterator status="status1" value="alienationMethodList" var="user">
            <tr class="<s:if test="#status1.odd == true">able-row-odd</s:if><s:else>table-row-even</s:else>t">
                <td class="left-align"><s:property value="id"/></td>
                <s:if test=" language=='en' ">
                  <td class="left-align"><s:property value="enName"/></td>
                </s:if>
                <s:elseif test=" language=='si' ">
                  <td class="left-align"><s:property value="siName"/></td>
                </s:elseif>
                <s:elseif test=" language=='ta' ">
                  <td class="left-align"><s:property value="taName"/></td>
                </s:elseif>

                <td class="right-align">
                    <s:url id="updateAlienationMethodId" action="loadAlienationMethodsForUpdate">
                        <s:param name="alienationMethodId" value="id"/>
                    </s:url>
                    <s:a href="%{updateAlienationMethodId}">
                        <img src="<s:url value='/images/modify-form.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>
                </td>
                <td></td>
            </tr>
        </s:iterator>
        </tbody>
    </table>
</div>

